package com.dragon.modules.yuegou.client.wechat_mini.security;

import com.dragon.modules.yuegou.client.wechat_mini.model.AccessToken;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

public class DefaultAccessTokenRepository implements AccessTokenRepository {

	private final ConcurrentMap<String, AccessToken> cache = new ConcurrentHashMap<>();

	@Override
	public AccessToken get(String appid) {
		return cache.get(appid);
	}

	@Override
	public AccessToken save(String appid, AccessToken accessToken) {
		cache.put(appid, accessToken);
		return accessToken;
	}
}
